package com.belinda.springboot_mybatis.controller;

import com.belinda.springboot_mybatis.model.Person;
import com.belinda.springboot_mybatis.service.impl.IndexServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class IndexController {

    @Autowired
    private IndexServiceImpl indexService;
    @RequestMapping("/index")
    public String index(){
        return "index";
    }

    @RequestMapping("/list")
    public List<Person> personList(){
        return  indexService.personList();
    }
}
